<?php

include_once($GLOBALS['MODEL2_BASEDIR'].'langres/login_res.inc.php');
include_once($GLOBALS['cfgPaths']['etcPath'].'var_main.inc.php');

class OrderPaymentDeliveryAction extends WebAction
{

    function execute($env)
    {
        $af = new ActionForm();
        $af->setArray($env->getSession('cust'));
        $af->set('CUST_PAYMENTMODE', $env->param('CUST_PAYMENTMODE'));
        $af->set('CUST_DELIVERER', $env->param('CUST_DELIVERER'));
        $env->setSession('cust', $af->getArray());
        switch ($af->get('CUST_PAYMENTMODE'))
        {
            case 1:
                $this->copyResources($af, 'payment_views', array('step4', 'cash_text', 'next'));
                $this->forward('order/cashOnDeliveryView', $af);
                break;
            case 3:
                $this->copyResources($af, 'payment_views', array('step4', 'transfer', 'accountno', 
                    'bank_code', 'bank_inst', 'next'));
                $af->set('blz',   $GLOBALS['cfgXICSShop']['blz']);
                $af->set('konto', $GLOBALS['cfgXICSShop']['konto']);
                $af->set('bank', $GLOBALS['cfgXICSShop']['bank']);
                $this->forward('order/prepaymentView', $af);
                break;
            case 4:
                $this->copyResources($af, 'payment_views', array('step4', 'mail_address_text', 'next'));
                $af->set('mail_address', $GLOBALS['cfgXICSShop']['mail_address']);
                $this->forward('order/depositOnlyCheckView', $af);
                break;
            case 5:
                $this->copyResources($af, 'payment_views', array('step4', 'account_data', 'bank_inst', 
                    'accountno', 'bank_code', 'next'));
                $this->forward('order/debitView', $af);
                break;
            case 6:
                $this->copyResources($af, 'payment_views', array('step4', 'bill_text', 'next'));
                $this->forward('order/billView', $af);
                break;
        }
    }

}

?>